	
// Ejerforhold.h : Declaration of the CEjerforhold

#ifndef __EJERFORHOLD_H_
#define __EJERFORHOLD_H_

#include "resource.h"       // main symbols
#include "importado.h"
#include "adresse.h"

/////////////////////////////////////////////////////////////////////////////
// CEjerforhold
class ATL_NO_VTABLE CEjerforhold : 
	public CComObjectRootEx<CComMultiThreadModel>,
	public CComCoClass<CEjerforhold, &CLSID_Ejerforhold>,
	public ISupportErrorInfo,
	public IDispatchImpl<IEjerforhold, &IID_IEjerforhold, &LIBID_EBASDLLLib>
{
public:
	CEjerforhold()
	{
		m_pUnkMarshaler = NULL;
		m_pAdresse = NULL;
	}
	virtual ~CEjerforhold()
	{

	}

DECLARE_REGISTRY_RESOURCEID(IDR_EJERFORHOLD)
DECLARE_NOT_AGGREGATABLE(CEjerforhold)
DECLARE_GET_CONTROLLING_UNKNOWN()

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CEjerforhold)
	COM_INTERFACE_ENTRY(IEjerforhold)
	COM_INTERFACE_ENTRY(IDispatch)
	COM_INTERFACE_ENTRY(ISupportErrorInfo)
	COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
END_COM_MAP()

	HRESULT FinalConstruct()
	{
		return CoCreateFreeThreadedMarshaler(
			GetControllingUnknown(), &m_pUnkMarshaler.p);
	}

	void FinalRelease()
	{
		m_pUnkMarshaler.Release();
	}

	CComPtr<IUnknown> m_pUnkMarshaler;

// ISupportsErrorInfo
	STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);

// IEjerforhold
public:
	STDMETHOD(Slet)();
	STDMETHOD(get_Adresse)(/*[out, retval]*/ IAdresse * *pVal);
	STDMETHOD(put_Adresse)(/*[in]*/ IAdresse * newVal);
	STDMETHOD(SetInfo)();
	STDMETHOD(get_GUID)(/*[out, retval]*/ BSTR *pVal);
	STDMETHOD(put_GUID)(/*[in]*/ BSTR pVal)
	{
		m_guid = pVal;
		return S_OK;
	}
	STDMETHOD(get_Leder)(/*[out, retval]*/ BSTR *pVal);
	STDMETHOD(put_Leder)(/*[in]*/ BSTR newVal);

private:
// Data
	IAdresse * m_pAdresse;
	
	bstr_t m_guid;
	bstr_t m_leder;  
};

#endif //__EJERFORHOLD_H_
